package edu.whu.rose.clock.kps.algorithm.blinks.search2;

import edu.whu.rose.clock.util.priorityqueue.FibonacciHeapPQ;
import edu.whu.rose.clock.util.priorityqueue.UnderflowException;

public class GroupHeap2 {

	private FibonacciHeapPQ<Cursor2> heap;
	
	public GroupHeap2() {
		heap = new FibonacciHeapPQ<Cursor2>();
	}
	
	public void enqueue(Cursor2 knc) {
		heap.enqueue(knc);
	}
	
	public Cursor2 dequeue() {
		Cursor2 knc = null;
		try {
			knc = heap.dequeueMin();
		}
		catch (UnderflowException ex) {
			ex.printStackTrace();
		}
		return knc;
	}
	
	public double top() {
		try {
			return heap.findMin().peek();
		}
		catch (UnderflowException ex) {
			ex.printStackTrace();
		}
		return -1.0d;
	}
	
	public boolean isEmpty() {
		return heap.isEmpty();
	}

}
